package cn.tedu_two;

import java.util.*;

public class Test1 {
    public static void main(String[] args) {
        List l=new ArrayList();
        l.add(51);
        l.add(66.6);
        l.add(66.6);
        l.add(null);
        l.add(null);
        l.add(99);
        l.add(0,55);
        System.out.println(l.add(99));
        System.out.println(l);
        System.out.println(l.get(2));
        System.out.println(l.set(3,88));
        System.out.println(l.indexOf(66.6));
        System.out.println(l.lastIndexOf(null));
        l.remove(2);
        System.out.println(l.remove(3));
        l.remove(new Integer(99));
        System.out.println(new Integer(99));
        System.out.println(l.subList(1,3));

        Object[] o=l.toArray();
        System.out.println(Arrays.toString(o));

        Iterator a=l.iterator();
        while(a.hasNext()) {
            if (a != null) {
                Object oo = a.next();
                System.out.println(oo);
            }
        }
        ListIterator b=l.listIterator();
        while(b.hasNext()) {
            if (b != null) {
                Object ooo = b.next();
                System.out.println(ooo);
            }
        }
        for (int i = 0; i < l.size(); i++) {
            System.out.println(l.get(i));
        }

        for(Object x:l){
            System.out.println(x);
        }
    }
}
